package test.db.table.oracle.type;

import test.db.table.Table;
import test.db.util.DBUtil;

/**
 * @author newbie
 * @since 0.1
 */
public enum PwEnvironment implements Table {
	PARTITION_SIZE(Column.partitionSize),
	VERSION(Column.version);

    private final Column column;
    private static final String TYPE_PARTITION_SIZE = "VARCHAR2(5)";
    private static final String TYPE_VERSION = "VARCHAR2(10)";
    
    PwEnvironment(Column column) {
    	this.column = column;
    }
    
    private enum Column {
    	partitionSize {
    		String getType() {
    			return TYPE_PARTITION_SIZE;
    		}
    	},
    	
    	version {
    		String getType() {
    			return TYPE_VERSION;
    		}
    	};
    	
    	abstract String getType(); 
    }
    
    /* (non-Javadoc)
     * @see test.db.table.Table#getType()
     */
    public String getType() {
        return column.getType();
    }

    /* (non-Javadoc)
     * @see test.db.table.Table#initData()
     */
    public void initData() throws Exception {
        DBUtil.addData("INSERT INTO PW_ENVIRONMENT (PARTITION_SIZE, VERSION) VALUES ('3000', '0.1')");
    }    
}